package cn.yuanqiao.archive.sealmanage.domain;

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.alibaba.fastjson.JSONArray;

public class SealManage extends BaseEntity {

    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_SEALMANAGE";

    public SealManage() {
        //String tenantCode = SecurityUtils.getTenantCode();
        String tenantCode = SecurityUtils.getLoginUser().getUser().getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    @IdAnnotation
    private Long id;

    private Long categoryId;

    private String tableName;
    //门类
    private String category;
    //1：启用 0：未启用
    private String state;
    //颜色
    private String color;
    //字体
    private String font;
    //边框粗细
    private Integer fontBold;
    //总体高度
    private Integer totalHeight;
    //总体宽度
    private Integer totalWidth;
    //字号
    private Integer fontSize;
    //位置
    private String align;
    //X位置
    private Integer xPosition;
    //Y位置
    private Integer yPosition;
    //行数
    private Integer rowNum;
    //列数
    private Integer colNum;
    //归档章样式json
    private String tableStyle;
    //归档章加在首页或每一页
    private String imagePath;

    //总体高度
    private Integer totalHeightPx;
    //总体宽度
    private Integer totalWidthPx;

    public Integer getTotalHeightPx() {
        return totalHeightPx;
    }

    public void setTotalHeightPx(Integer totalHeightPx) {
        this.totalHeightPx = totalHeightPx;
    }

    public Integer getTotalWidthPx() {
        return totalWidthPx;
    }

    public void setTotalWidthPx(Integer totalWidthPx) {
        this.totalWidthPx = totalWidthPx;
    }

    private JSONArray tableStyleJson;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getFont() {
        return font;
    }

    public void setFont(String font) {
        this.font = font;
    }


    public Integer getTotalHeight() {
        return totalHeight;
    }

    public void setTotalHeight(Integer totalHeight) {
        this.totalHeight = totalHeight;
    }

    public Integer getTotalWidth() {
        return totalWidth;
    }

    public void setTotalWidth(Integer totalWidth) {
        this.totalWidth = totalWidth;
    }

    public Integer getFontSize() {
        return fontSize;
    }

    public void setFontSize(Integer fontSize) {
        this.fontSize = fontSize;
    }

    public String getAlign() {
        return align;
    }

    public void setAlign(String align) {
        this.align = align;
    }

    public Integer getxPosition() {
        return xPosition;
    }

    public void setxPosition(Integer xPosition) {
        this.xPosition = xPosition;
    }

    public Integer getyPosition() {
        return yPosition;
    }

    public void setyPosition(Integer yPosition) {
        this.yPosition = yPosition;
    }

    public Integer getRowNum() {
        return rowNum;
    }

    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum;
    }

    public Integer getColNum() {
        return colNum;
    }

    public void setColNum(Integer colNum) {
        this.colNum = colNum;
    }

    public String getTableStyle() {
        return tableStyle;
    }

    public void setTableStyle(String tableStyle) {
        this.tableStyle = tableStyle;
    }

    public JSONArray getTableStyleJson() {
        return tableStyleJson;
    }

    public void setTableStyleJson(JSONArray tableStyleJson) {
        this.tableStyleJson = tableStyleJson;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    @Override
    public Long getCategoryId() {
        return categoryId;
    }

    @Override
    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getFontBold() {
        return fontBold;
    }

    public void setFontBold(Integer fontBold) {
        this.fontBold = fontBold;
    }

    @Override
    public String toString() {
        return "SealManage{" +
                "id=" + id +
                ", tableName='" + tableName + '\'' +
                ", category='" + category + '\'' +
                ", state='" + state + '\'' +
                ", color='" + color + '\'' +
                ", font='" + font + '\'' +
                ", fondBold=" + fontBold +
                ", totalHeight=" + totalHeight +
                ", totalWidth=" + totalWidth +
                ", fontSize=" + fontSize +
                ", align='" + align + '\'' +
                ", xPosition=" + xPosition +
                ", yPosition=" + yPosition +
                ", rowNum=" + rowNum +
                ", colNum=" + colNum +
                ", tableStyle='" + tableStyle + '\'' +
                '}';
    }
}
